<html>
<body>
<pre>
<?php

require_once("../../../Bootstrap.php");

$step = 100;
$width = 500;
$height = 500;

$gd = new raster();
$gd->createResource($width+1,$height+1,250,250,250,0);
$black = $gd->createColour(0,0,0);

set_time_limit(30);
//	---------|
//           |
//           |
//           |
//           |
$start = new cPoint3(0,0,-5);
$end = new cPoint3(500,0,-5);
for($pos=0;$pos<=$height;$pos+=$step)
{
	$start->setX($pos);
	$end->setY($pos);
	$gd->drawLine($start,$end,$black);
}

set_time_limit(30);
//  |         
//  |         
//  |         
//  | 
//	|---------  
$start = new cPoint3(0,500,-5);
$end = new cPoint3(0,500,-5);
for($pos=0;$pos<=$height;$pos+=$step)
{
	$start->setY($height - $pos);
	$end->setX($width - $pos);
	$gd->drawLine($start,$end,$black);
}

set_time_limit(30);
//	         |
//           |
//           |
//           |
//  ---------|
$start = new cPoint3(500,0,-5);
$end = new cPoint3(0,500,-5);
for($pos=0;$pos<=$height;$pos+=$step)
{
	$start->setY($pos);
	$end->setX($width - $pos);
	$gd->drawLine($start,$end,$black);
}

set_time_limit(30);
//	|---------
//  |         
//  |         
//  |         
//  | 
$start = new cPoint3(0,0,-5);
$end = new cPoint3(0,0,-5);
for($pos=0;$pos<=$height;$pos+=$step)
{
	$start->setY($height - $pos);
	$end->setX($pos);
	$gd->drawLine($start,$end,$black);
}

$gd->render('out.png');
?>
</pre>
<img src="out.png"/>
</body>
</html>